<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:s="http://www.springframework.org/security/tags">
	<s:authorize ifAllGranted="ROLE_ADMIN">
		<h:form>
			<p:panel>
				<f:facet name="header">
					<h:outputText value="#{msg['menu.groups']}"/>
				</f:facet>
				<p:dataTable width="100%" id="groupsList" rows="20"
					columnClasses="col" value="#{groupBean.all}" var="group">
					<p:column style="width:1px">
						<f:facet name="header">
							<h:commandLink action="#{groupBean.add}">
								<f:setPropertyActionListener
									target="#{groupBean.item}"
									value="#{group}"/>
								<h:graphicImage value="/images/add.png"/>
							</h:commandLink>
						</f:facet>
						<h:commandLink action="#{groupBean.edit}">
							<f:setPropertyActionListener
								target="#{groupBean.item}"
								value="#{group}"/>
							<h:graphicImage value="/images/edit.png"/>
						</h:commandLink>
					</p:column>
					<p:column style="width: 1px">
						<h:commandLink action="#{groupBean.delete}"
							update="groupsList">
							<f:setPropertyActionListener
								target="#{groupBean.item}"
								value="#{group}"/>
							<h:graphicImage value="/images/delete.png"/>
						</h:commandLink>
					</p:column>
					<p:column styleClass="userNameCol" sortBy="#{group.name}">
						<f:facet name="header">
							<h:outputText styleClass="headerText"
								value="#{msg['group.name']}"/>
						</f:facet>
						<h:outputText id="name" value="#{group.name}"/>
					</p:column>
				</p:dataTable>
			</p:panel>
		</h:form>
	</s:authorize>
</ui:composition>
